home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / comm / term / term_47a_pch.lha / Update-term4.7 < prev    next >
Text File  |  1996-11-11  |  3KB  |  89 lines

  1. ; $VER: Update-term4.7 1.2 (11.11.96)
  2.  
  3. (complete 0)
  4.  
  5. (message (cat "Make sure you are using the most recent version of Installer "
  6.               "(this would be V43.3) or you might have problems updating the "
  7.               "program."
  8. ))
  9.  
  10. (message (cat "This script will update `term' v4.7 to v4.7a. Before the program "
  11.               "is updated, a backup copy of your old v4.7 release will be made "
  12.               "just in case something goes wrong. This requires that you have "
  13.               "at least 600K bytes free storage space available on your hard "
  14.               "disk drive. The script can tell the plain 68k version and the 020+ "
  15.               "version apart, so you do not need to worry about picking the wrong "
  16.               "version."
  17. ))
  18.  
  19. (set original (askfile (prompt "Please locate the `term' v4.7 program")
  20.                        (default "TERM:")
  21.                        (help (cat "Before the installation can proceed "
  22.                                   "you need to indicate where `term' 4.7 "
  23.                                   "was installed."
  24.                        ))
  25. ))
  26.  
  27. (if (<> (exists original (noreq)) 1)
  28. (
  29.     (abort (cat "Could not locate file " original))
  30. ))
  31.  
  32. (set size (getsize original))
  33. (set vers (getversion original))
  34. (set version (/ vers 65536))
  35. (set revision (- vers (* version 65536)))
  36. (set spaceleft (getdiskspace original))
  37.  
  38. (if (< spaceleft 600000)
  39. (
  40.     (abort (cat ("Not enough storage space left, %ld bytes are available, we need at least 600,000 bytes." spaceleft)))
  41. ))
  42.  
  43. (if (= 0 version)
  44. (
  45.     (abort (cat ("Sorry, %s cannot be patched." original)))
  46. ))
  47.  
  48. (if (and (<> size 552404) (<> size 548168))
  49. (
  50.     (abort (cat ("Hm... %s does not look like `term' v4.7." original)))
  51. ))
  52.  
  53. (if (or (<> version 4) (and (= version 4) (<> revision 7)))
  54. (
  55.     (if (not (askbool (prompt (cat ("This appears to be v%ld.%ld, not v4.7, but I might be wrong. Do you still want to update the program?" version revision))
  56.                  )
  57.                  (help   (cat  "The file could not be safely identified as being `term' v4.7, but "
  58.                                "the Installer may have failed to read the program version number "
  59.                                "correctly. It might be safe to continue as the program to apply "
  60.                                "the patch will have the last word in this matter."
  61.                  ))
  62.                  (default 1)
  63.     )))
  64.     (
  65.         (abort "Your `term' file was not updated.")
  66.     ))
  67. ))
  68.  
  69. (set @default-dest (pathonly original))
  70.  
  71. (rename original (tackon @default-dest "term-4.7-old"))
  72.  
  73. (if (= size 548168)
  74.     (set patchfile "term-020-47a.pch")
  75.     (set patchfile "term-any-47a.pch")
  76. )
  77.  
  78. (working "Updating `term' to v4.7a")
  79.  
  80. (run ("spatch -o%s -p%s %s" (tackon @default-dest "term") patchfile (tackon @default-dest "term-4.7-old")))
  81.  
  82. (complete 100)
  83.  
  84. (message (cat "Keep the old file! Keep it or you might regret it! Subsequent updates might be "
  85.               "based upon the old version"
  86. ))
  87.  
  88. (exit ("Your old %s file was renamed to %s." original (tackon @default-dest "term-4.7-old")))
  89.